﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using DeepEarth.Core;
using DeepEarth.Map.Core.Tiling;

namespace DeepEarth.Map.Core
{
    public interface IMap
    {
        #region Properties

        DependencyProperty ViewDependencyProperty {get;}
        string ViewDependencyPropertyPath { get; }

        MapView View { get; set; }
        FrameworkElement AsFrameworkElement { get; }
        double ZoomLevel { get; set; }

        UIElementCollection BaseChildren { get; }

        LocationRectangle BoundingRectangle { get; }

        BaseTileSourceProvider TileSourceProvider { get; set; }

        Layer Children { get; }

        bool IsWrapped { get; }

        bool IsInteractive { get; set; }
        
        #endregion

        #region Events
        event EventHandler ViewChangeOnFrame;
        event EventHandler ViewChangeEnd;
        #endregion

        #region Interaction

        void Pan(double deltaX, double deltaY);
        void Zoom(double delta);

        bool DisableZoom { get; set; }
        #endregion

        #region Conversion
        Location ViewportPointToLocation(Point point);
        Point LocationToViewportPoint(Location location);
        #endregion

        Location CurrentCenter { get; }

        double CurrentViewportLogicalWidth { get; }

        IMap CreateInstance();

        Panel OverlayPanel { get; set; }

        RasterOverlayCollection BaseRasterOverlayCollection { get; }
        Canvas BaseDynamicLayer { get; }
        VectorLayerCollection BaseVectorLayerCollection { get;  }
        Canvas BaseLabelLayer { get; }

        Panel InteractionSurface { get; set; }

        bool ApplyDefaultNavigationCommand { get; set; }

        ICommand NavigateCommand { get; set; }

        AnimationLevel AnimationLevel { get; set; }
    }
}